#ifndef _VECTOR_H_
#define _VECTOR_H_
#include "RenzoVector.h"
#include "RenzoMath.h"
/*
// rotate around the arbitrary axis v 
void Vector3f::RotateArbitrary(Vector3f p, Vector3f v, float angle) {
	// theta is the angle between v and Z axis
	// phi is the angle between v projected on XY plane and the Y axis
	// d is the length of the projected v on XY plane
	float d = sqrt(v.x*v.x + v.y*v.y);
	float theta = atan(d / fabs(v.z));
	float phi = atan(fabs(v.x) / fabs(v.y));
	
	// the result matrix
	float m[16];
	Math::MatrixIdentity(m);
	// shift the coordinate system to v's position
	float T[16];
	Math::Translate(-p, T);
	// rotate the coordinate system around Z a phi angle -> d match Y
	float Rz[16];
	Math::RotateZ(-phi, Rz);
	// rotate the coordinate system around X a theta angle -> v match Z
	float Rx[16];
	Math::RotateX(-theta, Rx);
	// roate this vector around Z axis
	float Rvz[16];
	Math::RotateZ(angle, Rvz);
	// rotate the coordinate system around X back
	float Rx1[16];
	Math::RotateX(theta, Rx1);
	// rotate the coordinate system around Z back
	float Rz1[16];
	Math::RotateZ(phi, Rz1);
	// shift the coordinate system back
	float T1[16];
	Math::Translate(p, T1);
	
	Math::MultiplyMatrix(m, T, m);
	Math::MultiplyMatrix(m, Rz, m);
	Math::MultiplyMatrix(m, Rx, m);
	Math::MultiplyMatrix(m, Rvz, m);
	Math::MultiplyMatrix(m, Rx1, m);
	Math::MultiplyMatrix(m, Rz1, m);
	Math::MultiplyMatrix(m, T1, m);
	
	// transform
	float fThis[] = {x, y, z, 1};
	float fOut[4];
	Math::TransformVector(m, fThis, fOut);
	x = fOut[0]; y = fOut[1]; z = fOut[2];
}

*/


#endif
